﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>newekecontrol</title>
<style type="text/css" rel="stylesheet">
body {font-size:12px;margin: 0px;background-color3:#F0F0EE;background-color:#fff;over4flow: hidden;}
h1{ font-weight:normal;font-size:16px;}
a{text-decoration:none;display:inline-block;border-radius:5px;padding-left:18px;padding-right:18px;line-height:28px;}

a:hover{ background-color:#319CE3;color:#ffffff;}
</style>
<script type="text/javascript">
var KE = parent.KindEditor;
location.href.match(/\?id=([\w-]+)/i);
var id = RegExp.$1;
KE.event.ready(function() {
	if(parent.ControlJson)
	{
		var data=parent.ControlJson;
		var html='';
		for(i=0;i<data.length;i++)
		{
			html+='<h1>' + data[i].name + '</h1>';
			var items=data[i].items;
			for(j=0;j<items.length;j++)
			{
				if(items[j].type=="data")
				{
					html+='<a href="javascript:;" onclick="insert(\'{data:' + items[j].code + '}\');">' + items[j].name + '</a>';
				}
				else
				{
					html+='<a href="javascript:;" onclick="insert(\'{model:' + items[j].modelid + '}\');">' + items[j].name + '(模块)</a>';
				}
			}
		}
		document.body.innerHTML=html;
	}
}, window, document);

function insert(html)
{
	KE.plugin["newekecontrol"].insert(id,html);
};
</script>
</head>
<body>
</body>
</html>